﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DesignPattern.FacadePattern
{
    //核心类,将多个系统的方法进行组合,外观模式
    public  class Facade
    {
        private SubClassA _SubClassA;
        private SubClassB _SubClassB;
        private SubClassC _SubClassC;
        public Facade()
        {
            _SubClassA = new SubClassA();
            _SubClassB = new SubClassB();
            _SubClassC = new SubClassC();
        }

        public void MethodA()
        {
            Console.WriteLine("方法组A");
            _SubClassA.MethodOne();
            _SubClassB.MethodTwo();
        }

        public void MethodB()
        {
            Console.WriteLine("方法组B");
            _SubClassA.MethodOne();
            _SubClassC.MethodThree();
        }
    }
}
